﻿using System;
using Microsoft.Practices.ObjectBuilder;
using SignalR;
using System.Web.UI;
using System.Web.Services;

namespace Locator.Admin.Views
{
    public partial class StoreScanner : Microsoft.Practices.CompositeWeb.Web.UI.UserControl, IStoreScannerView
    {
        private StoreScannerPresenter presenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.presenter.OnViewInitialized();
            }

            this.presenter.OnViewLoaded();
        }

        [CreateNew]
        public StoreScannerPresenter Presenter
        {
            get { return this.presenter; }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");

                this.presenter = value;
                this.presenter.View = this;
            }
        }

        public void SetResults(string results)
        {
            
        }

        public override void Dispose()
        {
            if (this.presenter != null)
            {
                this.presenter.Dispose();
            }

            base.Dispose();
        }
    }
}

